home *** CD-ROM | disk | FTP | other *** search
- /*
- - Edit.sman
- -
- - ARexx program to edit the content of a file.
- - The editor tool depends of the file extension.
- - The tool is launched asynchronously.
- -
- - © Copyright 1995-1996 Bernard Krummenacher Silicon-Peace
- -
- - Bernard Krummenacher Silicon-Peace 95.04.11 Created this file.
- - Bernard Krummenacher Silicon-Peace 96.08.14 Tried to make it usable with almost any Amiga..
- */
-
- parse arg FileName '.' Extension
-
- options results
-
- if (UPPER(Extension) = 'MUIB') then
- address COMMAND 'mui:muibuilder/muibuilder ' '"'FileName'.'Extension'"'
- else
- if (((lastpos('SCOPTIONS',upper(FileName)) + 8) = length(FileName)) & (Extension = '')) then
- do
- path = left(FileName,lastpos('/',FileName))
- oldPath = pragma('Directory',path)
- address COMMAND 'scopts'
- pragma('Directory',oldPath)
- end;
- else
- /*
- if (UPPER(Extension) = 'GUIDE') then
- address COMMAND 'Appls:Outils/AmigaGuide/Heddley/Heddley ' FileName'.'Extension
- else
- */
- do
- EnvVar = 'env:editor'
- if (EXISTS(EnvVar)) then
- do
- if OPEN(EditorVar,'env:editor','R') then
- do
- Editor = READLN(EditorVar)
- if CLOSE(EditorVar) then
- nop
- end;
- end;
- else
- Editor = 'ed'
- if (Extension = '') then
- address COMMAND Editor '"'FileName'"'
- else
- address COMMAND Editor '"'FileName'.'Extension'"'
- end;
- return 0
-